const STATIC_DOMAIN = process.env.VUE_APP_STATIC_URL;
const QI_NIU_DOMAIN = process.env.VUE_APP_QI_NIU_DOMAIN;

export const getImageUrl = (path = '') => {
  if (!path) return path;
  if (/^https?:\/\/(.*)/.test(path)) {
    return path;
  }
  if (path.indexOf('#qiniu') > -1) {
    return QI_NIU_DOMAIN + path;
  }
  return `${STATIC_DOMAIN + path}?v=1`;
};
